<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="app">
        <ur>
            <li v-for="(item,index) in list" :key="id">
                {{item.id}}.{{item.name}}
                <button @click="list.splice(index,1)">删除</button>
            </li>
        </ur>
    </div>
    <script>
        const { createApp } = Vue
        createApp({
            data() {
                return {
                    list: [
                        { id: 1, name: '苹果', },
                        { id: 2, name: '香蕉', },
                        { id: 3, name: '草莓', },
                        { id: 4, name: '西瓜', },
                        { id: 5, name: '葡萄', },
                    ]
                }
            }
        }).mount('#app')
    </script>
</body>

</html>